#include <iostream>
using namespace std;

int main(){
    int currentVal = 0, val = 0;
    if (cin >> currentVal){
        int cnt = 1;
        while (cin >> val){
            if (currentVal == val){
                cnt++;
            } else{
                cout << currentVal << "出现了" << cnt << "次" << endl;
                currentVal = val;
                cnt = 1;
            }
        }

        cout << currentVal << "出现了" << cnt << "次" << endl;
    }

    return 0;
}
